const express = require("express");
const router = express.Router();
const leaves = require("../database/models/message");
const parseToken = require("../middlewares/parseToken");

router.post("/", [parseToken], async function (req, res) {
    //    添加中间件，通过则执行添加留言
    await leaves.create({
        account: req.token.account, message: req.body.message
    });
    return res.status(200).send({ good: "留言成功！" });
})
module.exports = router;